import { DependenciesDef } from 'create-ts-next';

export const Dependencies: Record<string, DependenciesDef> = {
  typescript: {
    devDependencies: {
      'tslib'      : '^2.6.1',
      '@types/node': '^18.11.9',
      'typescript' : '^5.1.6',
      'ts-node'    : '^10.9.1',
    },
  },
  eslint    : {
    devDependencies: {
      'eslint'                          : '^8.47.0',
      '@typescript-eslint/parser'       : '^6.3.0',
      '@typescript-eslint/eslint-plugin': '^6.3.0',
      'eslint-plugin-react'             : '^7.33.1',
      'eslint-plugin-react-hooks'       : '^4.6.0',
    },
  },
  prettier : {
    devDependencies: {
      'prettier'       : '^3.0.1'
    },
  },
  webpack   : {
    devDependencies: {
      'webpack'           : '^5.88.2',
      'webpack-cli'       : '^5.1.4',
      'webpack-dev-server': '^4.15.1',
      '@types/webpack'    : '^5.28.1',
      // basic
      'browserslist': '^4.21.10',
      'cross-env'   : '^7.0.3',
      // dotenv
      'dotenv'         : '^16.3.1',
      'dotenv-defaults': '^5.0.2',
      'dotenv-webpack' : '^8.0.1',
      // css / postcss / css-extract
      'css-loader'             : '^6.8.1',
      'style-loader'           : '^3.3.3',
      'postcss'                : '^8.4.27',
      'postcss-loader'         : '^7.3.3',
      'postcss-preset-env'     : '^9.1.1',
      'postcss-flexbugs-fixes' : '^5.0.2',
      'autoprefixer'           : '^10.4.15',
      'mini-css-extract-plugin': '^2.7.6',
      // minimizer
      'terser-webpack-plugin'       : '^5.3.9',
      'css-minimizer-webpack-plugin': '^5.0.1',
      // other loaders
      'file-loader'  : '^6.2.0',
      '@svgr/webpack': '^8.0.1',
      'url-loader'   : '^4.1.1',
      // other plugins
      'html-webpack-plugin'                 : '^5.5.3',
      'react-dev-utils'                     : '^12.0.1',
      'copy-webpack-plugin'                 : '^11.0.0',
      'case-sensitive-paths-webpack-plugin' : '^2.4.0',
      '@pmmmwh/react-refresh-webpack-plugin': '^0.5.10',
      'react-refresh'                       : '^0.14.0',
      'tsconfig-paths-webpack-plugin'       : '^4.1.0',
      'webpack-manifest-plugin'             : '^5.0.0',
    },
  },
  // tailwindcss: {
  //   devDependencies: {
  //     'tailwindcss': '^3.0.23'
  //   }
  // },
  windicss: {
    devDependencies: {
      'windicss'               : '^3.5.6',
      'windicss-webpack-plugin': '^1.7.8',
    },
  },
  swc     : {
    devDependencies: {
      '@swc/cli'           : '^0.1.62',
      '@swc/core'          : '^1.3.76',
      '@swc/helpers'       : '^0.5.1',
      'swc-loader'         : '^0.2.3',
      'regenerator-runtime': '^0.14.0',
    },
  },
} as const;

export const ViteDependencies = {
  devDependencies: {
    'vite'                     : '^4.4.9',
    '@vitejs/plugin-react-swc' : '^3.3.2',
    'postcss-nesting'          : '^12.0.1',
    'vite-plugin-svgr'         : '^3.2.0',
    'vite-plugin-windicss'     : '^1.9.1',
    '@import-meta-env/unplugin': '^0.4.9',
    'vite-plugin-static-copy'  : '^0.17.0',
  },
}

export const React17Dependencies = {
  dependencies   : {
    'react'    : '^17',
    'react-dom': '^17',
    'react-is' : '^17',
  },
  devDependencies: {
    '@types/react'    : '^17',
    '@types/react-dom': '^17',
    '@types/react-is' : '^17',
  },
};

export const React18Dependencies = {
  dependencies   : {
    'react'    : '^18.2.0',
    'react-dom': '^18.2.0',
    'react-is' : '^18.2.0',
  },
  devDependencies: {
    '@types/react'    : '^18.2.20',
    '@types/react-dom': '^18.2.7',
    '@types/react-is' : '^18.2.1',
  },
};

export const AppDependencies = {
  dependencies: {
    'react-app-provider': '^1.0.7',
  },
};
